Most
column types support a rudimentary type of validation, allowing you to
select whether the column must have a value (in most cases). Some
columns are even more specific, requiring you to, for example, specify
a minimum and a maximum for a Number column. However, sometimes you need more validation options than are available.
Some SharePoint columns
support a formula-based validation mechanism similar to Microsoft Excel
formulas. This mechanism is available for columns under the Column
Validation heading, and this heading is collapsed by default. Expanding
this section reveals two additional settings that you can set for the
column.
The first option is the
formula. Here you can type a formula that is evaluated when the user
tries to save the value for that column. For example, you can add a
formula to prevent the word test from being used as a value:
In this example, you replace column_name with the name of the actual column you are validating, as shown in Figure 1.
The second option you can
set in this section is the message that is displayed to the user when
validation fails. For example, you can write The word "test" is not an appropriate value for this column. This message is displayed to the user below the column in red text, as shown in Figure 2.
You can also enforce validation based on comparison between two columns.